# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=bittwist
pkgver=2.0
pkgrel=2
pkgdesc='A simple yet powerful libpcap-based Ethernet packet generator. It is designed to complement tcpdump, which by itself has done a great job at capturing network traffic.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-sniffer' 'blackarch-networking')
url='http://bittwist.sourceforge.net/'
license=('GPL')
depends=('libpcap>=1.2.1')
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-linux-$pkgver.tar.gz")
sha512sums=('c4e569f06c9b8e742538fa7ec3c3d3bc374d910461d049c1eddf4351603b8e4650f8925df04973365af5765d7c73dbbaeefa64f99bfeadbba1a26348f1ea8327')

prepare() {
  cd "$pkgname-linux-$pkgver"

  sed -i "s|^INSTALL =.*$|INSTALL = $(which install) -c|" Makefile
}

build() {
  cd "$pkgname-linux-$pkgver"

  make
}

package() {
  cd "$pkgname-linux-$pkgver"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" AUTHORS BUGS CHANGES \
    README VERSION
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"

  make prefix="$pkgdir/usr" install
}

